	function add_new_LSTPRD(){
		var LSTPRD = document.getElementById('LSTPRD').value;	
		var LSTPRDlist = document.getElementById('LIST_LSTPRD').value;
		var LSTPRD_arr = LSTPRDlist.split('|');
		var stringLSTPRD='';
		var num=0;
		for(i in LSTPRD_arr){
			if (LSTPRD_arr[i]==LSTPRD){
				num=1;
				break;
			}
		}
		if(num==0){
			stringLSTPRD = LSTPRD;
			document.getElementById('LIST_LSTPRD').value = document.getElementById('LIST_LSTPRD').value + stringLSTPRD +"|";
		}
	}
	
	function delete_LSTPRD(){
		var i;
		var num=0;
		var LSTPRD = document.getElementById('LSTPRD').value;
		var LSTPRDlist = document.getElementById('LIST_LSTPRD').value;
		var LSTPRD_arr = LSTPRDlist.split('|');
		if(LSTPRDlist.replace('|','')==LSTPRD){
			document.getElementById('LIST_LSTPRD').value='';
			num=1;
		}
		if(num==0){
			for(i in LSTPRD_arr){
				if(LSTPRD_arr[i]==LSTPRD){	
					LSTPRDlist = LSTPRDlist.replace(LSTPRD+'|','');
				}
			}
			document.getElementById('LIST_LSTPRD').value = LSTPRDlist;
		}
	}
	
		function add_new_LSTSBVCD1(){
		var LSTSBVCD1 = document.getElementById('LSTSBVCD1').value;	
		var LSTSBVCD1list = document.getElementById('LIST_LSTSBVCD1').value;
		var LSTSBVCD1_arr = LSTSBVCD1list.split('|');
		var stringLSTSBVCD1='';
		var num=0;
		for(i in LSTSBVCD1_arr){
			if (LSTSBVCD1_arr[i]==LSTSBVCD1){
				num=1;
				break;
			}
		}
		if(num==0){
			stringLSTSBVCD1 = LSTSBVCD1;
			document.getElementById('LIST_LSTSBVCD1').value = document.getElementById('LIST_LSTSBVCD1').value + stringLSTSBVCD1 +"|";
		}
	}
	
	function delete_LSTSBVCD1(){
		var i;
		var num=0;
		var LSTSBVCD1 = document.getElementById('LSTSBVCD1').value;
		var LSTSBVCD1list = document.getElementById('LIST_LSTSBVCD1').value;
		var LSTSBVCD1_arr = LSTSBVCD1list.split('|');
		if(LSTSBVCD1list.replace('|','')==LSTSBVCD1){
			document.getElementById('LIST_LSTSBVCD1').value='';
			num=1;
		}
		if(num==0){
			for(i in LSTSBVCD1_arr){
				if(LSTSBVCD1_arr[i]==LSTSBVCD1){	
					LSTSBVCD1list = LSTSBVCD1list.replace(LSTSBVCD1+'|','');
				}
			}
			document.getElementById('LIST_LSTSBVCD1').value = LSTSBVCD1list;
		}
	}
	
		function add_new_LSTSBVCD5(){
		var LSTSBVCD5 = document.getElementById('LSTSBVCD5').value;	
		var LSTSBVCD5list = document.getElementById('LIST_LSTSBVCD5').value;
		var LSTSBVCD5_arr = LSTSBVCD5list.split('|');
		var stringLSTSBVCD5='';
		var num=0;
		for(i in LSTSBVCD5_arr){
			if (LSTSBVCD5_arr[i]==LSTSBVCD5){
				num=1;
				break;
			}
		}
		if(num==0){
			stringLSTSBVCD5 = LSTSBVCD5;
			document.getElementById('LIST_LSTSBVCD5').value = document.getElementById('LIST_LSTSBVCD5').value + stringLSTSBVCD5 +"|";
		}
	}
	
	function delete_LSTSBVCD5(){
		var i;
		var num=0;
		var LSTSBVCD5 = document.getElementById('LSTSBVCD5').value;
		var LSTSBVCD5list = document.getElementById('LIST_LSTSBVCD5').value;
		var LSTSBVCD5_arr = LSTSBVCD5list.split('|');
		if(LSTSBVCD5list.replace('|','')==LSTSBVCD5){
			document.getElementById('LIST_LSTSBVCD5').value='';
			num=1;
		}
		if(num==0){
			for(i in LSTSBVCD5_arr){
				if(LSTSBVCD5_arr[i]==LSTSBVCD5){	
					LSTSBVCD5list = LSTSBVCD5list.replace(LSTSBVCD5+'|','');
				}
			}
			document.getElementById('LIST_LSTSBVCD5').value = LSTSBVCD5list;
		}
	}
	
	
	function valbutton_branh(thisform,objname) {
		var objradio = thisform.radioTK;
		var radioLength = objradio.length;
		var id, i;
		if(!radioLength){
			id = objradio.value;		
		}else{
			for(i = 0; i < radioLength; i++){
				if(thisform.radioTK[i].checked){
					id = thisform.radioTK[i].value;
					break;
				}
			}
		}
		var name = id.split('-');	
		//alert(objname);
		var lblname = objname.split('-');
		var obj1 = window.opener.document.getElementById(lblname[0]);
		var obj2 = window.opener.document.getElementById(lblname[1]);
		if(obj1){
			obj1.value = name[0];
			var phongtructhuoc = window.opener.document.getElementById("phongtructhuoc");
			if(phongtructhuoc){
				phongtructhuoc.click();	
			}
		}
		if(obj2){
			obj2.value = name[1];
		}
		
		window.close();
	}